package com.yuch.service.impl.bak;

import com.yuch.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

//@Service
public class MessageServiceImpl implements MessageService {

    List<String> list=new ArrayList<String>();
    @Override
    public String sendMessage(String id) {
        System.out.println("消息添加到队列:"+id);
        list.add(id);
        return id;
    }

    @Override
    public String doMessage() {
        String id =  list.remove(0);
        System.out.println("消息发送成功:"+id);
        return id;
    }
}
